public class code {
    public static void fanc(int[] arr){
        int sz = arr.length;
        int L = 0;
        int R = sz - 1;
        while(L < R){
            while(L < R && arr[L] % 2 != 0){
                L++;
            }
            while(L < R &&  arr[R] % 2 == 0){
                R--;
            }
            int temp = arr[L];
            arr[L] = arr[R];
            arr[R] = temp;
        }
    }
    public static void main(String[] args) {
        int [] arr = {1,2,3,4,5,6,7,8,9,0};
        for (int x : arr){
            System.out.print(x + " ");
        }
        System.out.println();
        fanc(arr);
        for (int x : arr){
            System.out.print(x + " ");
        }
    }
}
